import { IMG_TYPES, VIDEO_TYPES } from '@/const/file';

/**
 * @description: 文件类型检查
 * @param {FILE} item
 * @return {*}
 */
export const checkFileType = (url?: string) => {
	if (!url) return null;
	const arr = url.split('.')
	const type = arr[arr.length - 1];
	if (IMG_TYPES.includes(type)) return 'img';
	if (VIDEO_TYPES.includes(type)) return 'video';
	return null;
};
